package com.imc.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ImcUserfriendId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class ImcUserfriendId implements java.io.Serializable {

	// Fields

	private Integer uid;
	private Integer friend;
	private Integer clusterOrgan;

	// Constructors

	/** default constructor */
	public ImcUserfriendId() {
	}

	/** full constructor */
	public ImcUserfriendId(Integer uid, Integer friend, Integer clusterOrgan) {
		this.uid = uid;
		this.friend = friend;
		this.clusterOrgan = clusterOrgan;
	}

	// Property accessors

	@Column(name = "uid", nullable = false)
	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	@Column(name = "friend", nullable = false)
	public Integer getFriend() {
		return this.friend;
	}

	public void setFriend(Integer friend) {
		this.friend = friend;
	}

	@Column(name = "cluster_organ", nullable = false)
	public Integer getClusterOrgan() {
		return this.clusterOrgan;
	}

	public void setClusterOrgan(Integer clusterOrgan) {
		this.clusterOrgan = clusterOrgan;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ImcUserfriendId))
			return false;
		ImcUserfriendId castOther = (ImcUserfriendId) other;

		return ((this.getUid() == castOther.getUid()) || (this.getUid() != null
				&& castOther.getUid() != null && this.getUid().equals(
				castOther.getUid())))
				&& ((this.getFriend() == castOther.getFriend()) || (this
						.getFriend() != null && castOther.getFriend() != null && this
						.getFriend().equals(castOther.getFriend())))
				&& ((this.getClusterOrgan() == castOther.getClusterOrgan()) || (this
						.getClusterOrgan() != null
						&& castOther.getClusterOrgan() != null && this
						.getClusterOrgan().equals(castOther.getClusterOrgan())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getUid() == null ? 0 : this.getUid().hashCode());
		result = 37 * result
				+ (getFriend() == null ? 0 : this.getFriend().hashCode());
		result = 37
				* result
				+ (getClusterOrgan() == null ? 0 : this.getClusterOrgan()
						.hashCode());
		return result;
	}

}